// 签名
import _bale from '../utils/package.js'
// 获取不同的接口地址
import { COMMON_API,OEDER_API,AFTER_API } from '../config/index.js'
import { Service } from '../utils/server.js'
class OrderModel extends Service {
  getOrderList(params) {
     return this.postRequest(OEDER_API + '/order/selectOrder', {
      data: _bale('selectOrderList', params)
    })
  }

  //删除订单
  delOrder(params) {
    return this.postRequest(OEDER_API + '/order/deleteOrder', {
      data:_bale('deleteOrder',params)
    })
  }

  //撤销订单
  revokeOrder(params) {
    return this.postRequest(OEDER_API + '/order/revokeOrder', {
      data:_bale('revokeOrder',params)
    })
  }

  //获取订单详情
  getOrderDetail(params) {
    return this.postRequest(OEDER_API + '/order/selectOrderDetails', {
      data:_bale('selectOrderDetails',params)
    })
  }

  //用户确认收货
  confirmGoods(params) {
    return this.postRequest(OEDER_API + '/order/confirmReceipt', {
      data:_bale('confirmReceipt',params)
    })
  }

  //取消并退款
  cancelGoods(params) {
    return this.postRequest(AFTER_API + '/return/userCancelsRefund', {
      data:_bale('userCancelsRefund',params)
    })
  }

  //更换尺码
  changeSize(params) {
    return this.postRequest(OEDER_API + '/order/changeSpec', {
      data:_bale('changeSpec',params)
    })
  }

  //申请售后
  applyProve(params) {
    return this.postRequest(AFTER_API + '/return/applyRefund', {
      data:_bale('applyRefund',params)
    })
  }

  //提交售后
  submitProve(params) {
    return this.postRequest(AFTER_API + '/return/submitRefund', {
      data:_bale('submitRefund',params)
    })
  }

  //查询评价商品
  evaluateGoods(params) {
    return this.postRequest(OEDER_API + '/order/evaluateGoods', {
      data:_bale('evaluateGoods',params)
    })
  }

  //新增评价
  addEvaluate(params) {
    return this.postRequest(COMMON_API + '/evaluate/addEvaluate', {
      data:_bale('evaluateGoods',params)
    })
  }

  //批量查询评价商品
  evaluateGoodsList(params) {
    return this.postRequest(OEDER_API + '/order/evaluateGoodsList', {
      data:_bale('evaluateGoodsList',params)
    })
  }

  //批量新增评价
  addAllEvaluate(params) {
    return this.postRequest(COMMON_API + '/evaluate/addAllEvaluate', {
      data:_bale('addAllEvaluate',params)
    })
  }
}

export { OrderModel }
